package com.itlong.cloud.property;


import com.itlong.cloud.noncore.commons.IVisitorPushMessageServiceClient;
import org.slf4j.Logger;import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.RestController;

/**
 * <desc>
 * 定时刷新访客表获取未推送的APP新增访客信息.
 * </desc>
 *
 * @createDate 2018/7/5
 */
@EnableScheduling // 启用定时任务
@RestController
public class VisitorPushMessageTimedTask {
    private static Logger LOG = LoggerFactory.getLogger(VisitorPushMessageTimedTask.class);

    @Autowired
    IVisitorPushMessageServiceClient iVisitorPushMessageServiceClient;


    @Scheduled(cron = "0/5 * * * * ?") // 每5秒执行一次
    public void timeTaskSychro() throws Exception {

        try {
            iVisitorPushMessageServiceClient.visitorPushMessage();
//            LOG.info("【定时任务】定时刷新访客表获取未推送的APP新增访客信息推送成功");
        } catch (Exception e) {
            throw e;
        }

    }
}